<%
	// 当前页
	var currentPage = page.pageNumber;
	// 总页数
	var totalPage   = page.totalPage;

	// 对于不够分页的直接跳出
	if (totalPage <= 0 || currentPage > totalPage || totalPage == 1) {
		return;
	}
	// 表示显示的按钮数量，请为设置为奇数个
	var _btn_count = isEmpty(btnCount) ? 7 : btnCount;

	var _temp_count = _btn_count / 2;
	var startPage, endPage;
	// 以7页作为参考的话，小于5页，开始添加新按钮
	if (currentPage < _temp_count + 1) {
		startPage = 1;
		endPage = _btn_count + 1;
	} else {
		startPage = currentPage - _temp_count + 1;
		endPage = currentPage + _temp_count + 1;
	}
	// 尾页不足_btn_count时补全, *注意：* beetl尾页补全。 如for(var i in range(1,5)) {print(i)},将依次打印1234
	if ((totalPage - currentPage) < _temp_count) {
		startPage = totalPage - _btn_count + 1;
		endPage = totalPage + 1;
	}
	if (startPage < 1) {
		startPage = 1;
	}

	// 判断URL是否含有?
	actionUrl = (strutil.index(actionUrl, "?") == -1) ? actionUrl + "?" : actionUrl + "&";
%>
<div class="pagination">
	<% if (currentPage == 1) { %>
		<span class="disabled prev_page">上页</span>
	<% } else { %>
		<a href="${actionUrl}#{currentPage - 1}${urlParas!}" class="prev_page">上页</a>
	<% } %>

	<% for(var i in range(startPage, endPage)) { %>
		<% if (currentPage == i) { %>
			<span class="current">#{i}</span>
		<% } else { %>
			<a href="${actionUrl}#{i}${urlParas!}">#{i}</a>
		<% } %>
	<% } %>

	<% if (currentPage == totalPage) { %>
		<span class="disabled next_page">下页</span>
	<% } else { %>
		<a href="${actionUrl}#{currentPage + 1}${urlParas!}" class="next_page" rel="next">下页</a>
	<% } %>
</div>